import request from '@/utils/request'

// 专区课程分页
export function zonePostPage(data) {
  return request({url: '/course/admin/zone/post/page', method: 'post', data})
}

// 专区实验修改
export function zonePostEdit(data) {
  return request.put('/course/admin/zone/post/edit', data)
}

// 专区实验保存
export function zonePostSave(data) {
  return request.post('/course/admin/zone/post/save', data)
}

// 专区实验修改
export function zonePostDelete(data) {
  return request.delete('/course/admin/zone/post/delete?id=' + data.id, data)
}

// 专区分页
export function zonePage(data) {
  return request({url: '/course/admin/zone/page', method: 'post', data})
}

// 专区修改
export function zoneEdit(data) {
  return request.put('/course/admin/zone/edit', data)
}

// 专区保存
export function zoneSave(data) {
  return request.post('/course/admin/zone/save', data)
}

// 专区修改
export function zoneDelete(data) {
  return request.delete('/course/admin/zone/delete?id=' + data.id, data)
}

// 分类列表
export function categoryList(data) {
  return request({url: '/course/admin/category/list', method: 'post', data: data})
}

// 分类修改
export function categoryEdit(data) {
  return request.put('/course/admin/category/edit', data)
}

// 分类保存
export function categorySave(data) {
  return request.post('/course/admin/category/save', data)
}

// 分类修改
export function categoryDelete(data) {
  return request.delete('/course/admin/category/delete?id=' + data.id, data)
}

// 资源分页
export function resourcePage(params, pageCurrent = 1, pageSize = 20) {
  return request({url: '/course/admin/resource/page', method: 'post', data: {pageCurrent: pageCurrent, pageSize: pageSize, ...params}})
}

// 资源修改
export function resourceEdit(data) {
  return request.put('/course/admin/resource/edit', data)
}

// 资源保存
export function resourceSave(data) {
  return request.post('/course/admin/resource/save', data)
}

// 资源修改
export function resourceDelete(data) {
  return request.delete('/course/admin/resource/delete?id=' + data.id, data)
}

// 实验章节分页
export function courseChapterPeriodPage(params, pageCurrent = 1, pageSize = 20) {
  return request({url: '/course/admin/post/chapter/period/page', method: 'post', data: {pageCurrent: pageCurrent, pageSize: pageSize, ...params}})
}

// 实验章节修改
export function courseChapterPeriodEdit(data) {
  return request.put('/course/admin/post/chapter/period/edit', data)
}

// 实验章节保存
export function courseChapterPeriodSave(data) {
  return request.post('/course/admin/post/chapter/period/save', data)
}

// 实验章节修改
export function postChapterPeriodDelete(data) {
  return request.delete('/course/admin/post/chapter/period/delete?id=' + data.id, data)
}

// 实验章分页
export function postChapterPage(params, pageCurrent = 1, pageSize = 20) {
  return request({url: '/course/admin/post/chapter/page', method: 'post', data: {pageCurrent: pageCurrent, pageSize: pageSize, ...params}})
}

// 实验章修改
export function postChapterEdit(data) {
  return request.put('/course/admin/post/chapter/edit', data)
}

// 实验章保存
export function postChapterSave(data) {
  return request.post('/course/admin/post/chapter/save', data)
}

// 实验章修改
export function postChapterDelete(data) {
  return request.delete('/course/admin/post/chapter/delete?id=' + data.id, data)
}

// 通知公告分页
export function postPage(params, pageCurrent = 1, pageSize = 20) {
  return request({url: '/course/admin/post/page', method: 'post', data: {pageCurrent: pageCurrent, pageSize: pageSize, ...params}})
}

// 通知公告详情
export function postView(id) {
  return request.get('/course/admin/post/view?id=' + id)
}

// 通知公告修改
export function postEdit(data) {
  if (data.liulanqi) {
    data.liulanqi = data.liulanqi.toString();
  }
  return request.put('/course/admin/post/edit', data)
}

// 通知公告保存
export function postSave(data) {
  if (data.liulanqi) {
    data.liulanqi = data.liulanqi.toString();
  }
  return request.post('/course/admin/post/save', data)
}

// 通知公告修改
export function postDelete(data) {
  return request.delete('/course/admin/post/delete?id=' + data.id, data)
}

// 分页
export function userpostPage(params, pageCurrent = 1, pageSize = 20) {
  return request({url: '/course/admin/user/post/page', method: 'post', data: {pageCurrent: pageCurrent, pageSize: pageSize, ...params}})
}

// 分页
export function userStudyePage(params, pageCurrent = 1, pageSize = 20) {
  return request({url: '/course/admin/user/study/page', method: 'post', data: {pageCurrent: pageCurrent, pageSize: pageSize, ...params}})
}
